package table

import (
	"time"
)

// AdminUser admin_user
type AdminUser struct {
	ID         int32
	DateCreate time.Time
	DateModify time.Time

	Username string // 帐户名
	Password []byte // 密码
	Salt     []byte // 密码盐
	IsLocked bool   // 帐号是否被锁(被禁能)

	RealName string // 实际名
	Phone    string // 联系电话
	Email    string // 邮件
	Sex      uint8  // 性别
}

// AdminLog admin_log
type AdminLog struct {
	ID         int32
	DateCreate time.Time
	// DateModify time.Time

	Description   string // 描述
	IDAdminUser   int32
	DetailInvolve string // 记录细节
}

// AdminPermission admin_permission
type AdminPermission struct {
	ID         int32
	DateCreate time.Time
	DateModify time.Time

	IDParents       int32  // 上级编号(没有则以自身为上级编号)
	Name            string // 名字
	Type            uint8  // 类型
	ValuePermission int    // 权限值

	Isdisable bool // 是否被禁用
}

// AdminRole admin_role
type AdminRole struct {
	ID         int32
	DateCreate time.Time
	DateModify time.Time

	Name        string // 角色名
	Title       string // 角色标题
	Description string // 角色描述
}

// AdminRolePermission admin_role_permission
type AdminRolePermission struct {
	ID         int32
	DateCreate time.Time
	DateModify time.Time

	IDAdminRole       int32
	iDAdminPermission int32
}

// AdminUserRole admin_user_role
type AdminUserRole struct {
	ID         int32
	DateCreate time.Time
	DateModify time.Time

	IDAdminUser int32
	IDAdminRole int32
}

// AdminCertification admin_certfication -- 格式通用于 redis
type AdminCertification struct {
	ID             int32
	IDAdminUser    int32
	token          string
	DatetimeExpire time.Time
	DatetimeDelete time.Time
}
